convert machine learning model to a rest api